<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Update MyAccount Page</title>
<jsp:include page="/WEB-INF/jspf/header.jsp"></jsp:include>
</head>
<body class="metro">
	<div class="grid" style="padding-left: 15px;">
		<div class="row">
			<div class="span4">
				Welcome &quot;${sessionScope.rslt.fname}&quot;
				<div class="grid" style="padding-right: 20px;">
					<jsp:include page="/WEB-INF/jspf/leftmenu.jsp"></jsp:include>
				</div>
			</div>
			<div class="span8">
				<div class="div-header">
					<h3 class="head-title">Edit Account Details</h3>
				</div>
				<form method="POST" action="editmyaccnt">

					<table border="0" class="table hovered" width="317">
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td><font SIZE="2"></font></td>
							<td><input id="uid" type="hidden" name="T1"
								value="${sessionScope.rslt.uid}" class="outputtext" size="30" /></td>
						</tr>
						<tr>
							<td><font SIZE="2">First Name</font></td>
							<td><input id="fname" type="text" required="required"
								name="T2" value="${sessionScope.rslt.fname}" class="outputtext"
								size="30" /></td>
						</tr>
						<tr>
							<td><font SIZE="2">Last Name</font></td>
							<td><input id="lname" type="text" required="required"
								name="T3" value="${sessionScope.rslt.lname}" class="outputtext"
								size="30" /></td>
						</tr>
						<tr>
							<td><font SIZE="2">Phone no</font></td>
							<td><input id="phn" type="text" required="required"
								name="T4" value="${sessionScope.rslt.phn}" class="outputtext"
								size="30" /></td>
						</tr>
						<tr>
							<td><font SIZE="2">Email id</font></td>
							<td><input id="eid" type="text" disabled name="T5"
								value="${sessionScope.rslt.eid}" class="outputtext" size="30" /></td>
						</tr>
						<tr>
							<td><font SIZE="2">Address</font></td>
							<td><input id="addrs" type="text" required="required"
								name="T6" value="${sessionScope.rslt.addrs}" class="outputtext"
								/></td>
							<!-- 							<td><textarea rows="2" name="S2" cols="20" id="addrs" required="required"  -->
							<%-- 						class="outputtext" size="30" >${sessionScope.rslt.addrs}</textarea></td> --%>
						</tr>
						<tr>
							<td>&nbsp;</td>
<!-- 							<td><input type="submit" value="Update" class="button small info"></td> -->
								<td><input type="button" value="Update" class="button small info" onclick="updateData()" /></td>
						</tr>
					</table>
					<span id="data"></span>
				</form>
			</div>
		</div>
	</div>
</body>
	<script type="text/javascript">
	var reqst = new XMLHttpRequest();
	updateData = function(){
		var updtdData = "uid=" + document.getElementById("uid").value 
						+"&fname=" + document.getElementById("fname").value  
						+"&lname=" + document.getElementById("lname").value 
						+"&phn=" + document.getElementById("phn").value
						+"&eid=" + document.getElementById("eid").value
						+"&addrs=" + document.getElementById("addrs").value;
		reqst.onload = function(){
			document.getElementById("data").innerHTML = this.responseText;
// 			alert(this.responseText);
// 			alert(updtdData);
			};
	reqst.open("post", "editmyaccnt", true);
	reqst.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	reqst.send(updtdData);
	};
</script>
</html>